﻿using System.Windows.Controls;
using System.Windows.Navigation;
using Silverlight.EntityFramework;
using Silverlight.HierarchicalModel.Model;

namespace Silverlight.HierarchicalModel
{
    public partial class Home : Page
    {
        public Home()
        {
            InitializeComponent();

            CollectionEntity<ObjectEntity> items = new CollectionEntity<ObjectEntity>();
            items.Add(new ObjectEntity() { Name = "Press Me!" });
            treeView1.ItemsSource = items;
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            dataForm1.CurrentItem = dataGrid1.SelectedItem;
        }

        private void dataGrid2_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            dataForm2.CurrentItem = dataGrid2.SelectedItem;
        }
    }
}